/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DatabaseConnection;

import Factory.DAOFactory;
import java.sql.Connection;

/**
 *
 * @author Patrick
 */
public abstract class DBConnectionFactory {
    private static String datasource;
    
    
    public static DBConnectionFactory getInstance(int dataSource){
        switch (dataSource){
            case DAOFactory.MYSQL: datasource = "jdbc/moviestore";
                                   break;
            case DAOFactory.ORACLE:
                                    break;
        }
        return new DBConnectionFactoryImpl();
    }

    /**
     * @return the datasource
     */
    public static String getDatasource() {
        return datasource;
    }

    /**
     * @param aDatasource the datasource to set
     */
    public static void setDatasource(String aDatasource) {
        datasource = aDatasource;
    }
    
    public abstract Connection getConnection();

   
}
